{include file="$temps.head" title="$webs.title" keywords="$webs.keywords" description="$webs.description" /}
<ul class="layout fex-column or-tuan">
    <li id="addresbtn" class="pad-a10 b-b bg-fff mb-10 addrestext cx-fex">
        {present name="tuangou.conf.addres"}
        <div class="x11 fex-column">
            <div class="layout cx-fex">
                <span>收货人：{$tuangou.conf.adduname}</span>
                <span>手机：{$tuangou.conf.phone}</span>
            </div>
            <div class="layout">地址：{$tuangou.conf.addres}</div>
        </div>
        <div class="x1 cx-fex-c fex-items-c">
            <i class="cx-icon cx-icon-fanhui-copy-copy"></i>
        </div>
        {else /}
        <span>请选择地址</span>
        <i class="cx-icon cx-icon-fanhui-copy-copy"></i>
        {/present}
    </li>
    <li class="layout cx-fex-l bg-fff or-tuanshop">
        <a class="layout cx-fex-l" href="{:url('Article/index',array('aid'=>$tuangou.aid))}">
        <div class="xl3">
            <div class="or-tuan-img">
            {if $tuangou.picurl}
            <img class="img-responsive" src="{$tuangou.picurl}" alt="{$tuangou.title}" >
            {elseif $tuangou.pinimg /}
            <img class="img-responsive" src="{$tuangou.pinimg}" alt="{$tuangou.title}" >
            {else}
            <img class="img-responsive" src="{$tuangou.paid.0.picurl}" alt="{$tuangou.title}" >
            {/if}
            </div>
        </div>
        <div class="xl9 pad-l10 cx-fex-c fex-items-c">
            <h3 class="layout or-title">{$tuangou.title}</h3>
        </div>
        </a>
    </li>
</ul>
<form class="layui-form" action="{:url('index')}" method="post">
    <input type="hidden" name="aid" value="{$tuangou.aid}">
    <input class="addresval" type="hidden" name="addres" value="">
    <input class="zoneidval" type="hidden" name="zoneid" value="">
    <input class="phoneval" type="hidden" name="phone" value="">
    <input class="postalval" type="hidden" name="postal" value="">
    <input class="addunameval" type="hidden" name="adduname" value="">
    <input class="zoneidval" type="hidden" name="foid" value="{$Request.param.oid}">
    <div class="layout or-playk pos-f bg-fff cx-fex">
        <div class="t-gray t-14 pad-l10">
            <span class="mr-10">共支付：</span>
            <i class="cx-icon cx-icon-renminbi1688 t-red"></i>
            <span class="t-red t-18">
                {eq name="$tuangou.pinclass" value="正常团"}{$tuangou.pinmoney}{else /}0{/eq}
            </span>
        </div>
        <div>
            <button class="button bg-red" lay-submit lay-filter="button">立即支付</button>
        </div>
    </div>
</form>
<script>
    wx.config({
        // debug: true,
        appId: '{$webdb.wxappid}', // 必填，公众号的唯一标识
        timestamp: '{$wxjsapi.timestamp}', // 必填，生成签名的时间戳
        nonceStr: '{$wxjsapi.noncestr}', // 必填，生成签名的随机串
        signature: '{$wxjsapi.sing}',// 必填，签名
        jsApiList: [
            'openAddress',
        ] // 必填，需要使用的JS接口列表
    });
    wx.ready(function(){
        wx.openAddress({
            success: function (res) {
                var seeuser = res.provinceName + " " + res.cityName + " " + res.countryName + " " + res.detailInfo + "," + res.postalCode;
                $(".addrestext").text(res.userName + "," + res.telNumber + "," + seeuser);
                $(".addresval").val(seeuser);
                $(".postalval").val(res.postalCode);
                $(".zoneidval").val(res.nationalCode);
                $(".addunameval").val(res.userName);
                $(".phoneval").val(res.telNumber);
            }
        });
        document.querySelector('#addresbtn').onclick = function () {
            wx.openAddress({
                success: function (res) {
                    var seeuser = res.provinceName + " " + res.cityName + " " + res.countryName + " " + res.detailInfo + "," + res.postalCode;
                    $(".addrestext").text(res.userName + "," + res.telNumber + "," + seeuser);
                    $(".addresval").val(seeuser);
                    $(".postalval").val(res.postalCode);
                    $(".zoneidval").val(res.nationalCode);
                    $(".addunameval").val(res.userName);
                    $(".phoneval").val(res.telNumber);
                }
            });
        };
    });
    wx.checkJsApi({
        jsApiList: ['onMenuShareAppMessage'], // 需要检测的JS接口列表，所有JS接口列表见附录2,
        success: function(res) {

        }
    });
</script>
{include file="$temps.foot" /}